package com.gaohe;

import com.gaohe.mapper.UserMapper;
import com.gaohe.pojo.User;
import com.gaohe.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest(classes = Application.class)
public class MpTest02 {
    @Autowired
    private UserService service;

    @Test
    public void getAll(){
        System.out.println(service.list());
    }
    //新增
    @Test
    public void save(){
        User user = new User();
        user.setName("jiang2222");
        user.setPass("kai");
        user.setAge(18);
        user.setTel("22222222222");
        user.setClassName("二班");
        boolean save = service.save(user);
        System.out.println("save = " + save);
    }
    @Test
    public void modify(){
        User user = new User();
        user.setId(990380033l);
        user.setName("zhaohe");
        boolean b = service.updateById(user);

    }
    //删
    @Test
    public  void  deleteById(){
        boolean b = service.removeById(1535725570);
    }
}
